<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
    </ul>
</body>
</html>
<script>
    var ul=document.querySelector('ul')
    //  onmouseover鼠标滑过的元素
    ul.addEventListener('mouseover',function(e){
        //代表触发事件的元素
        console.log(e.target);
        //this代表绑定事件的元素
        console.log(this);
        //让当前滑过的li的背景变色
        e.target.style.backgroundColor='pink'
        
    })
    ul.addEventListener('mouseout',function(e){
        e.target.style.backgroundColor='white'
    })
</script>